package jk.zmn.server.utils;

public enum CODE {

	NOTFOUND(404,"<html>\r\n" + 
			"<head>\r\n" + 
			"    <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">\r\n" + 
			"</head>\r\n" + 
			"<body>\r\n" + 
			"<h1>404 NOT FOUND </h1>\r\n" + 
			"</form>\r\n" + 
			"</body>\r\n" + 
			"</html>"),ERROR(500,"<html>\r\n" + 
					"<head>\r\n" + 
					"    <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=UTF-8\">\r\n" + 
					"</head>\r\n" + 
					"<body>\r\n" + 
					"<h1>500`` SERVER ERROR </h1>\r\n" + 
					"</form>\r\n" + 
					"</body>\r\n" + 
					"</html>");
	
	int code;
	String value;
	CODE(int code,String value){
		this.code = code;
		this.value = value;
	}
	
	public int getCode() {
		return code;
	}
	public String getValue() {
		return value;
	}
	 public static int getCode(String value) {
         for (CODE emotional : values()) {
             if (emotional.getValue().equals(value)) return emotional.getCode();
         }
         return -1;
     }

	 public static String getValue(int code) {
         for (CODE emotional : values()) {
             if (emotional.getCode() == code) return emotional.getValue();
         }
         return null;
     }
}
